pkgname=firmware-xiaomi-ferrari
pkgver=1
pkgrel=1
pkgdesc="Firmware files for Xiaomi Mi 4i"
url="https://github.com/TheMuppets/proprietary_vendor_xiaomi"
arch="aarch64"
license="proprietary"
depends="wcnss-wlan alsa-ucm-conf soc-qcom-msm8916"
options="!strip !check !archcheck !tracedeps"

# Source
_files="a420_pfp.fw a420_pm4.fw maxtouch.fw maxtouch_biel.fw mba.mbn modem.b00 modem.b01 modem.b02 modem.b03 modem.b04 modem.b05 modem.b06 modem.b08 modem.b09 modem.b10 modem.b12 modem.b13 modem.b14 modem.b15 modem.b16 modem.b17 modem.b18 modem.b21 modem.b22 modem.b23 modem.b25 modem.b26 modem.mdt wcnss.b00 wcnss.b01 wcnss.b02 wcnss.b04 wcnss.b06 wcnss.b09 wcnss.b10 wcnss.b11 wcnss.mdt"
_files_prima="WCNSS_cfg.dat WCNSS_qcom_cfg.ini WCNSS_qcom_wlan_nv.bin"
_files_venus="venus.b00 venus.b01 venus.b02 venus.b03 venus.b04 venus.mbn venus.mdt"
_commit="cea573fb71f24a1466ae28735380d4178445cbe2"
_prima_commit="0e096905ac1db7a6aa726e797ad9a3f9ee0d9035"
_url="https://github.com/SUNGOLDSV/proprietary_vendor_xiaomi_ferrari/raw/$_commit/proprietary/etc/firmware"
_prima_url="https://github.com/SUNGOLDSV/device_xiaomi_ferrari/raw/$_prima_commit/wifi"
_venus_url="https://github.com/SUNGOLDSV/proprietary_vendor_xiaomi_ferrari/raw/$_commit/proprietary/etc/firmware/qcom/venus-1.8"
for _i in $_files; do
	source="$source $pkgname-$_commit-$_i::$_url/$_i"
done
for _i in $_files_prima; do
	source="$source $pkgname-$_commit-$_i::$_prima_url/$_i"
done
for _i in $_files_venus; do
	source="$source $pkgname-$_commit-$_i::$_venus_url/$_i"
done

package() {
	cd "$srcdir"

	# /lib/firmware/postmarketos
	for _i in $_files; do
		install -D -m644 "$pkgname-$_commit-$_i" \
			"$pkgdir/lib/firmware/postmarketos/$_i"
	done

	# /lib/firmware/postmarketos/wlan/prima
	for _i in $_files_prima; do
		install -D -m644 "$pkgname-$_commit-$_i" \
			"$pkgdir/lib/firmware/postmarketos/wlan/prima/$_i"
	done

	# /lib/firmware/postmarketos/qcom/venus-1.8
	for _i in $_files_venus; do
		install -D -m644 "$pkgname-$_commit-$_i" \
			"$pkgdir/lib/firmware/postmarketos/qcom/venus-1.8/$_i"
	done
}

sha512sums="dc6c1ce867f31a3e04a299b380c5625a7acf55fbf93c3f1b7097fe5e518b1649996d902f528c0e45859bfb436044401ddeebb70266da58d4ef7eacab926702b9  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-a420_pfp.fw
316be2e601b38fb3e7420f95d86b83f4eb363e08ae798c2bd8641da672ba71ed4ee25434e695f4cd3e750a194260155587ca7b92496348ee1b608af3eb374f53  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-a420_pm4.fw
60f7e4bebec014dd20cfd38b7dbd42e4a9d5edfafe9265e959534938f40ad9558a803174a6bebb009e5c45f93344846ddc664676bcb2aa7f4368216a52276af6  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-maxtouch.fw
84d8c383a01e3d1b49692d7900e237120f132b447e211c9e163ed9edc8333848486d58ea856de35984003901b80563c756c48421ea8f0978b150f479aaa8aa04  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-maxtouch_biel.fw
11351578739be87619e764a7f0040b5ddc41657c364453b4ab3f6bb93dbf76c9661bd0eea80680306e63c81d9a62ea4333e5d218add842a2d5948151bf4afc8c  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-mba.mbn
8526a60438608fd49eea1c51de917eeb80fea48ac918db28736d806f1fda349e873e971ce5454163717b1527b9321ab9b053f413a5505c4e0019db1046c99c36  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b00
aef854e525e1bb167ce46b29f0aa8193af3c17fbd88e9edea6e33a86fe7db6116d61f9d8e531db99c7adfffbc8d73b5ec11f20c25e1bc2f08a328687d06a4f35  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b01
361d3737ef8c216bc2679ea70d6d4cf92ed6d6a0f0fac25c164821089358b0f148a0a6e289b16a819ad141ea952e44c3096e1fcac63bc4c1a004c4d3df354670  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b02
1de2d05ba49970fdbbbd426bd80c0ca90e5e7e6fbec7ae139146fbb309abf56cd30dfd15718bc7d6733f9f99aaead531eb414da81e1a2d93c45bd65666bee994  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b03
2bfec435a3845d10621d2e177ef5299cf8f1c2fc2a9cd1c86e544165786a418d3756433325ea6eee19ec960035391249270084e695347459816c3fb21a08768e  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b04
b44cd815f38ce0235d57041a97012cd9970928308dac933b6bd4d21bb620b5d2b20668bae567d523b7efde92f3663d50629ba5fea6081dc611a3e2f1ae39afb1  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b05
732d91c2790a2a6e50ee1ebaf5c684c82b9b935c251822b8e9e685990910a8981952b413d7d9d65542bd3e37c54a5b139b3c4c3d83530b3d204c9b603283bb0d  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b06
f924ee816a4ed65ebedd4b0d1c997c573da71b7b0445b1d73bb8db9758c41f611fbf93fd339eb28e88e06dd5790a8e4b0370914e1645f2a5bb35dba6db4ea74c  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b08
47c7192a438a97a92d5e966f2eb3b265a549ba5eb1a6bc96fb7215bff063adf554a6f2f48d5370104907e4088a8dbb9ac686b9cc3d7553eb5c6ac7d8c7503918  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b09
725d2f1181b21ad259d497b25158bc8ef21ae9e49e134e43481935d22eacabffd73d7f70b98a70d6b8d1589f361972ca5f59159178fa47599636d872c9cacfab  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b10
59aa9b0d128c8e809595618251daead787d6b2af4152406f00b7d48c07ad72ed6c59420d43a8ca127b06bbb1463ab5f0493d1013dc0d7776f5416849e8af713c  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b12
bca9d922be47d47ab865bff591ea9317e1ac4b71fe1c9e252e00b8056eff70969d5f53f19c987d85ef3eab45419dd4eaa470115c59df4fd8f7c2131f0502cecc  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b13
f9a60a8093ad54d61d80f7d4c47002d12218fc4b660d7175fbc8232ca49979c091a9a43b06ffab7c9a6b097601b5afd86a1e122ec16d4a12593b4cff1ec95a86  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b14
2daf8c626f40f1641950ec81aa6a408085780488d68f62741dc01017d0c19e2d3ea09d72228a855f9b2d81dba20e4d73cfaac15a226a33451ef3de52f383f928  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b15
8c21429fb4e5bf3e78dcfa2469ce74a6bc1c31a2d522f0014ff3847df886ceb1418ec35546121c5414ac6e3ac6fc26e2edeb41265fb480dd964be0f483656899  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b16
b672d09ef3e982756142af6012b71047c24049c2bf55f11d9a04259fcefb9a414b3a3cae409248eb679f73fd94e9d8ba1db26cc043f81e087c5e08e2944d96e9  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b17
72998e29a0b60883220e21cd0eae0b2d19bb8e837507ff8c285e4ba72b1a70d2114cc05ec51ba8dcec264fed3ac0015071d2800a82a9fa0024591d200dbf0e52  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b18
50b265aa2f4e11771474e78727353d272281c74c7d5427c784241d0817606df9ee3a95d6681ad3f38143f0407b90e43a296a831bc3e298c95b34061b7e2e9a81  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b21
88e48dc36176627ea047d3c89abf84f67ca39e8d0023f94954e68f4e926fcce1f32fb3f34d06df78af419a15efdc633f47c776ed5be836aaf6ecad16f00b71ff  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b22
e9c22aedc310e02aea9c58dc50b7b5fb1a98cbf547933e5ed5c755f9fbff30339ddeee64bfeaf8621fc92f3db621c9ca528680a6b5363c8d4ca44c240da7ae2e  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b23
ce6be9a3a0a0a96ba060fd6f4693ae5f7b19ec2fcac476a6f8935644a70f363ffedcb846e895b6eade0a6d6ec921f767b68a6ba124dbcca2c3151062e2b879a1  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b25
7247b7cc8b708fc66de3d021f6172051c2fcd1f01e9c628a6c069460fae16848d0006c1ae274e1c6faf3bcd934f2f36048540b635a5d2af679bda02df15fabba  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.b26
bb415aa3e960506f080995edd8dcb49aae1221969444956afb1da7f1b960e54cdcd39080c76fa1ab6c2c6b0f1d90e33ec40e710acee10986c0275c20fc541cde  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-modem.mdt
cd7c5e582a624b1aa34e46d62259e646acf16cb22544d4d95cfa871af1078ff4805651051a433d8d073df74b4ee05bf5a3f58b1e180e34af46b9696a5c610d7e  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b00
af61d9e71389574ab9ef7c3e5ffa9cfd99cabf581d83aec2c68062cc29fafb3a6943eec44390f67d2f29a6df57259e55ed327e45ebdd874078cb7d89ad3cb6c3  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b01
c921fc7edc4a208b23b405482c6be351ba7a52e1c1162bc148247805f26e038782e7b1a436954dd57677d6311470f3edf7da8a5bb9fa02b8afa4c6f70c0c43ab  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b02
33aec5659e3226b7fba3c95a3064d6bc74f24223dab27455f0c168892826e1d1d8c758c0bde4bef94a7f10d6712343038e1941af2d8adb20aba5ac9ce56a6207  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b04
1bd5f3dc7314bfcd3f7423e6c0a1db3c712be1810177bb5fe20c25cd03913a0f4cb6265021e9b4bb0ac7cb08eb1019a614b11732479fe6680936a001ff5f9827  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b06
c331a2a21695186c1ebd2c9facdc5fa856bedc757a50936b72577e76147373747d26bacfce0e165f089e182cc227ada737a0b42e51d9bdec16fb5f8ca795b091  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b09
8a8f52b7cb06a2c78e980c75c794a64bd67e085ed52478e9f1aa734493f3e074b1f810eaff4760120b6c1a8d69a866e00fd43d414b8c85d1cc5117b6052db6c3  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b10
8b4e4c575c5f7e6c1aab9f798025ff515dd897b3921d9ca48a823ccfa9c41ba8bacdbc961317764fb9041c3dbbc8ebe955398f3a83fce613fec2e1e9847275fe  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.b11
2fe76aec3fbd313ab597bad6a424e59b7fa6265a08e601d34e8866b476185ec76b7b71aead91b8a29b1b887912e41fec47e99f016b87181604335c5aadfc2c07  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-wcnss.mdt
fb92214f928143228c0683934342ceff11f19bec0581684e98e155262bed03f51c21a21881ec03316f917c127b607a2943efea4847b908f1c02864a1e507fb50  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-WCNSS_cfg.dat
284fe8cfceff62b07089db11f994571de18554aa5d94cda825c36c1ec64cffab0acd0ae797fdb49bdb37ca47944cbd738da709e9f858fb459866f38f17163c98  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-WCNSS_qcom_cfg.ini
78060e3a4fa87ff5abd5eb649d9321a5c2c40b2eaeb411438dae97e0e78a62b3835bdc44d2880bb8b83359ec3b0ee845a17f4404f578854e59becb06a02fb0fc  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-WCNSS_qcom_wlan_nv.bin
c1cbe3b9db31ff06c001986b6a628f1a3d56bc3c60d182379baffe4110631e5be1f078dce3610001d089890a8a023c9af81bc4208602249f4c873e3d2969458a  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.b00
4233f274acef74754723e0a58c36941211980eef159dee67eea0154c46dcba8fd94f547899bc61a5e6fdda85208f47b22722c7fad1c083a1340d3408559813a1  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.b01
bf1c7f614fd7295f4eae0930252d09250fd0eba6782fdc3b359b611b63293e587ed5a3ac28ba8ed35f1ba7e88a5f4c2be587037fde59a4f6f7bd13899dd04c7c  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.b02
04df193b41fa9e591944c7488db1217ff17fa881afcbcf9abfba28bd07f391f1fd7dfe7e4cf74db1c8aac6de6caf57daa856bd45946c941cb277c14ddb7eb3dd  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.b03
3c3544528b44d39b205ac38944db67adb1d4a6e393256fdfa6958e580d09aa8a01196190d6cf64bd0fd8cdbf0399a8e8e87b5a7a62c6cd6b4b32db6d5390df26  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.b04
999bbcdeb5a63ce7af0a7f8e8ba2c101bdc80b329696405a2d7a3af17ac5cf798c2d6562863e7d3936d615e85d79344cfda23ca443a562eb7c9d9c477ea590fa  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.mbn
f9f76fefe5ae0148882a770d1841826600766c480739b7f72e81a5e57a83c62cdd397bf783896fea578fac7e324eeafdd71b47f2d728203cf175e804c1fdbf7c  firmware-xiaomi-ferrari-cea573fb71f24a1466ae28735380d4178445cbe2-venus.mdt"
